﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes {
    import flash.events.*;

    public class GameSettingsObject extends EventDispatcher {

        protected var m_xml:XML = null;
        protected var m_name:String = null;

        public function GameSettingsObject(_arg1:XML){
            this.m_xml = _arg1;
            this.m_name = this.m_xml.@name;
        }
        public function get name():String{
            return (this.m_name);
        }
        public function get xml():XML{
            return (this.m_xml);
        }
        protected function getFriendlyNameLocFile():String{
            throw (new Error("This function needs to be overriden"));
        }
        public function get localizedName():String{
            return (ZLoc.t(this.getFriendlyNameLocFile(), (this.name + "_friendlyName")));
        }
        public function get tooltipNotes():String{
            return (ZLoc.t(this.getFriendlyNameLocFile(), (this.name + "_notes")));
        }
        public function getImageByName(_arg1:String):String{
            var result:* = null;
            var images:* = null;
            var imageName:* = _arg1;
            result = null;
            images = this.m_xml.image.(@name == imageName);
            if (images.length()){
                result = Global.getAssetURL(images[0].@url);
            };
            return (result);
        }
        public function getRelativeImageByName(_arg1:String):String{
            var result:* = null;
            var images:* = null;
            var imageName:* = _arg1;
            result = null;
            images = this.m_xml.image.(@name == imageName);
            if (images.length()){
                result = images[0].@url;
            };
            return (result);
        }

    }
}//package Classes 
